namespace Communication
{
    /// <summary>
    /// Provides an interface for low-level access to the device.
    /// </summary>
    public interface ICommunication
    {
        /// <summary>
        /// Executes the specified command and returns the response received without verifying it.
        /// </summary>
        /// <param name="command">The ciommand to execute.</param>
        /// <param name="pattern">Specify the regular expression pattern that the received data must match to stop
        /// reading.</param>
        /// <returns>The response received.</returns>
        string ExecAndReceiveAnything(string command, string pattern);
        /// <summary>Executes the specified command and waits for multiple responses.</summary>
        /// <param name="command">The command to execute.</param>
        /// <returns>The response received.</returns>
        string ExecAndReceiveMultiple(string command);
        /// <summary>Executes the specified command and waits for a single response.</summary>
        /// <param name="command">The command to execute.</param>
        /// <returns>The response received.</returns>
        string ExecCommand(string command);
        /// <summary>
        /// Executes the specified command and waits for a single response.</summary>
        /// <param name="command">The command to execute.</param>
        /// <param name="receiveErrorMessage">The message text for the exception if no data is received.</param>
        /// <returns>The response received.</returns>
        string ExecCommand(string command, string receiveErrorMessage);
        /// <summary>
        /// Receives raw string data.</summary>
        /// <param name="input">The data received.</param>
        /// <returns>true if reception was successful, otherwise false.</returns>
        bool Receive(out string input);
        /// <summary>Waits for multiple responses.</summary>
        /// <returns>The response received.</returns>
        string ReceiveMultiple();
        /// <summary>Waits for multiple responses.</summary>
        /// <returns>The response received.</returns>
        /// <param name="pattern">Specify the regular expression pattern that the received data must match to
        /// stop reading, can be an empty string if the pattern should not be checked.</param>
        string ReceiveMultiple(string pattern);
        /// <summary>Sends raw string data.</summary>
        /// <param name="output">The data to send.</param>
        void Send(string output);
    }
}